package com.invengo.module_check.data.repsitory.common.source.impl;

import android.annotation.SuppressLint;

import com.invengo.base.http.RetrofitClient;
import com.invengo.base.utils.RequestBodyUtils;
import com.invengo.library_db.entity.module_check.offline.UserBean;
import com.invengo.module_check.data.api.CommonApi;
import com.invengo.module_check.data.repsitory.common.source.CommonSource;

import java.util.HashMap;
import java.util.Map;

import io.reactivex.Observable;
import me.goldze.mvvmhabit.http.BaseBean;

public class HttpCommonSourceImpl implements CommonSource {

    private CommonApi comService;

    public HttpCommonSourceImpl() {
        comService = RetrofitClient.getInstance().create(CommonApi.class);
    }
    @Override
    public Observable<BaseBean<UserBean>> checkLogin(String account, String password) {
//        KLog.e("查询网络");
        Map<String, Object> params = new HashMap();
        params.put("account", account);
        params.put("password", password);
        return comService.checkLogin(RequestBodyUtils.parse(params));
    }
}
